package com.timber.util;


import java.util.Vector;


public class SearchableComboTableModel extends SLTableModel
{

  static Vector v = new Vector();

  static
  {

    cm = new SearchableComboColumnManager();

    v.add( cm.getByIdClone( SearchableComboColumnManager.CODE));
    v.add( cm.getByIdClone( SearchableComboColumnManager.DESCR));

  }

  public SearchableComboTableModel(int rows)
  {
    super(rows, v);
    setAutoColumnClass(1);
  }

   public SearchableComboTableModel(Vector dataVector)
  {
    super( dataVector, v );
    setAutoColumnClass(1);
  }


  public Object getFieldAt( Object o, int c )
  {
    Object ret = null;

    if( o != null )
    {
      int id = getColumnId( c );
      SLDataObject item = (SLDataObject)o;

      switch(id)
      {
        case SearchableComboColumnManager.CODE:
	  ret = item.listString();
	  break;
	case  SearchableComboColumnManager.DESCR:
	  ret = item.getDescr();
	  break;

	}
    }
    return ret;
  }
}
